/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PanJoueurStatut.java
 *
 * Created on 21 déc. 2011, 23:16:28
 */
package InterfaceGraphique.commonPannel;

import common.Constantes;
import java.awt.Font;
import java.util.logging.Level;
import java.util.logging.Logger;
import plateau.Joueur;

/**
 *
 * @author Arthur
 */
public class PanJoueurStatut extends javax.swing.JPanel {

    /** Creates new form PanJoueurStatut */
    public PanJoueurStatut() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel3 = new javax.swing.JLabel();
        lJoueur = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        lSexe = new javax.swing.JLabel();
        lNiveau = new javax.swing.JLabel();

        jLabel3.setText("jLabel3");
        jLabel3.setName("jLabel3"); // NOI18N

        setBackground(new java.awt.Color(110, 48, 34));
        setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        setMinimumSize(new java.awt.Dimension(820, 63));
        setName(""); // NOI18N
        setPreferredSize(new java.awt.Dimension(820, 63));
        setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        lJoueur.setForeground(new java.awt.Color(213, 151, 0));
        lJoueur.setText("jLabel2");
        lJoueur.setName("lJoueur"); // NOI18N
        add(lJoueur, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 20, -1, -1));
        try {
            System.out.println(System.getProperties().get("user.dir"));
            Font font = Font.createFont(Font.TRUETYPE_FONT, getClass().getResourceAsStream("/polices/cartoon.ttf"));
            font = font.deriveFont(24.0f);
            this.lJoueur.setFont(font);
        } catch (Exception ex) {
            Logger.getLogger(PanActionInit.class.getName()).log(Level.SEVERE, null, ex);
        }

        jLabel4.setForeground(new java.awt.Color(213, 151, 0));
        jLabel4.setText("Niveau :");
        jLabel4.setName("jLabel4"); // NOI18N
        add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(580, 20, -1, -1));
        try {
            System.out.println(System.getProperties().get("user.dir"));
            Font font = Font.createFont(Font.TRUETYPE_FONT, getClass().getResourceAsStream("/polices/cartoon.ttf"));
            font = font.deriveFont(24.0f);
            this.jLabel4.setFont(font);
        } catch (Exception ex) {
            Logger.getLogger(PanActionInit.class.getName()).log(Level.SEVERE, null, ex);
        }

        jLabel5.setForeground(new java.awt.Color(213, 151, 0));
        jLabel5.setText("Sexe : ");
        jLabel5.setName("jLabel5"); // NOI18N
        add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 20, -1, -1));
        try {
            System.out.println(System.getProperties().get("user.dir"));
            Font font = Font.createFont(Font.TRUETYPE_FONT, getClass().getResourceAsStream("/polices/cartoon.ttf"));
            font = font.deriveFont(24.0f);
            this.jLabel5.setFont(font);
        } catch (Exception ex) {
            Logger.getLogger(PanActionInit.class.getName()).log(Level.SEVERE, null, ex);
        }

        lSexe.setForeground(new java.awt.Color(213, 151, 0));
        lSexe.setText("jLabel6");
        lSexe.setName("lSexe"); // NOI18N
        add(lSexe, new org.netbeans.lib.awtextra.AbsoluteConstraints(390, 20, -1, -1));
        try {
            System.out.println(System.getProperties().get("user.dir"));
            Font font = Font.createFont(Font.TRUETYPE_FONT, getClass().getResourceAsStream("/polices/cartoon.ttf"));
            font = font.deriveFont(24.0f);
            this.lSexe.setFont(font);
        } catch (Exception ex) {
            Logger.getLogger(PanActionInit.class.getName()).log(Level.SEVERE, null, ex);
        }

        lNiveau.setForeground(new java.awt.Color(213, 151, 0));
        lNiveau.setText("jLabel7");
        lNiveau.setName("lNiveau"); // NOI18N
        add(lNiveau, new org.netbeans.lib.awtextra.AbsoluteConstraints(680, 20, -1, -1));
        try {
            System.out.println(System.getProperties().get("user.dir"));
            Font font = Font.createFont(Font.TRUETYPE_FONT, getClass().getResourceAsStream("/polices/cartoon.ttf"));
            font = font.deriveFont(24.0f);
            this.lNiveau.setFont(font);
        } catch (Exception ex) {
            Logger.getLogger(PanActionInit.class.getName()).log(Level.SEVERE, null, ex);
        }
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel lJoueur;
    private javax.swing.JLabel lNiveau;
    private javax.swing.JLabel lSexe;
    // End of variables declaration//GEN-END:variables
    
    public void setJoueur( Joueur j ) {
        this.lJoueur.setText(j.getNom());
        this.lNiveau.setText((new Integer(j.getNiveau()).toString()));
        String sexe = (j.getSexe() == Constantes.SEX_FEM) ? "Femme" : "Homme";
        this.lSexe.setText(sexe);
    }
}
